package com.banshuibao.bsb_android.util;

import android.content.Context;
import android.text.TextPaint;
import android.text.style.ClickableSpan;
import android.view.View;

import com.banshuibao.bsb_android.R;


/**
 * Created by wangpan on 2016/12/14.
 * 这是实现不同颜色字的点击事件
 */
public class TextViewURLSpan extends ClickableSpan {

    private final Context context;

    public TextViewURLSpan(Context context) {
        this.context=context;
    }

    @Override
    public void updateDrawState(TextPaint ds) {
        ds.setColor(context.getResources().getColor(R.color.tag));
        ds.setUnderlineText(false); //去掉下划线
    }
    @Override
    public void onClick(View widget) {//点击事件
     //  Toast.makeText(context,"点击,uuid"+uuid+",name"+name, Toast.LENGTH_SHORT).show();
    }
}
